package com.dems.dao.config;

import com.alibaba.druid.spring.boot.autoconfigure.DruidDataSourceBuilder;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Primary;

import javax.sql.DataSource;

@Configuration
public class DataSourceCreate {

    @Bean
    @Primary
    @ConfigurationProperties(prefix = "spring.datasource.druid.la")
    public DataSource laDataSource() {
        return DruidDataSourceBuilder.create().build();

    }

    @Bean
    @ConfigurationProperties(prefix = "spring.datasource.druid.cl")
    public DataSource clDataSource() {
        return DruidDataSourceBuilder.create().build();
    }
}
